home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h_doc / Import < prev    next >
Text File  |  1996-05-21  |  3KB  |  87 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Import.h
  12.     Author:  Copyright © 1995 Julian Smith
  13.     Version: 1.00 (17 Jan 1995)
  14.     Purpose: File import handling.
  15. */
  16.  
  17.  
  18. #ifndef __Desk_Import_h
  19. #define __Desk_Import_h
  20.  
  21. #ifdef __cplusplus
  22.     extern "C" {
  23. #endif
  24.  
  25. #ifndef __Desk_Wimp_h
  26.     #include "Desk.Wimp.h"
  27. #endif
  28.  
  29.  
  30. typedef void (*Desk_import_fileimporter)( Desk_message_dataload *data, void *reference);
  31. /*
  32. This function-type should load data from the file specified in 'data'.
  33.  
  34. 'reference' is the reference originally passed to
  35. Desk_Import_RegisterFileLoader.
  36. */
  37.  
  38. typedef void *Desk_import_ramimporter;
  39. /*
  40. This will be changed sometime to be a function-type for importing using
  41. the RAM transfer protocol.
  42. */
  43.  
  44. void    Desk_Import_RegisterFileLoader( 
  45.         Desk_import_fileimporter    fn, 
  46.         Desk_import_ramimporter    ramfn,
  47.         Desk_window_handle        window, 
  48.         Desk_icon_handle        icon, 
  49.         void            *reference
  50.         );
  51. /*
  52. This registers an internal function (using Desk_Event_Claim) which is called
  53. whenver a file is dropped onto window-icon, and does all the
  54. Desk_Wimp_SendMessage stuff involved in the wimp file transfer protocol.
  55.  
  56. 'ramfn' is ignored at the moment - use NULL. Eventuall the Import
  57. library will support ram-transfer.
  58.  
  59. You supply a function 'fn' which will be called to do the actual file-loading, 
  60. using the information in the Desk_message_dataload structure.
  61. 'fn' will also be given 'reference' as passed in the original call to 
  62. Desk_Import_RegisterFileLoader, which can be used to give extra information.
  63.  
  64. NB Desk_message_dataload is defined in DeskLib:Wimp.h and has the following
  65. fields:
  66.     Desk_window_handle window;
  67.     Desk_icon_handle   icon;
  68.     Desk_wimp_point    pos;
  69.     int           estsize;
  70.     int           filetype;
  71.     char          filename[212];
  72.     
  73. The window, icon and pos are the mouse info for where the file was dropped.
  74. filetype and filename are as given by whoever is giving us the file.
  75.  
  76. 'fn' should *not* call Desk_Wimp_Poll, as it is called in the middle of
  77. the file-transfer protocol.
  78. */
  79.  
  80.  
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84.  
  85. #endif
  86.  
  87.